﻿using System;
using System.Collections.Generic;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace XiTi
{
    public class AnswerORC
    {
        Bitmap[] abcd = new Bitmap[4];
        string abcdStr = "ABCD";
        public AnswerORC()
        {
            abcd[0] = new Bitmap("abcd\\A.png");
            abcd[1] = new Bitmap("abcd\\B.png");
            abcd[2] = new Bitmap("abcd\\C.png");
            abcd[3] = new Bitmap("abcd\\D.png");
        }

        public int orc(Bitmap img)
        {
            int tt = 0;
            for (int p = 0; p < 4; p++)
            {
                tt = 0;
                for (int i = 0; i < img.Height; i++)
                {
                    for (int j = 0; j < img.Height; j++)
                    {
                        tt += Math.Abs(abcd[p].GetPixel(i, j).R - img.GetPixel(i, j).R);
                    }
                }
                if(tt<100) return p+1;
            }
            return 0;
        }
    }
}
